#include <iostream>
#include <conio.h>
#include <time.h>
#include "MainTank.h"

int main()
{
	Graphic::Create();
	MainTank maintank;
	bool loop=true;
	bool stop=false;
	while(loop)
	{
		if(kbhit())
			{
				int key=getch();
				switch(key)
				{
				case 72:
					maintank.SetDir(UP);break;
				case 80:
					maintank.SetDir(DOWN);break;
				case 75:
					maintank.SetDir(LEFT);break;
				case 77:
					maintank.SetDir(RIGHT);break;
				case 27:
					loop=false;
					Graphic::Destroy();
					break;
				case 13:
					if(!stop)  stop=true;
					else stop=false;
					break;
				default: break;

				}
			}
		if(!stop)
			{
				cleardevice();
				maintank.Display();
				maintank.Move();
			}
		Sleep(200);
	}

}

